package com.my.hotel.entity.serverPage;

import com.my.hotel.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * todo 最好卸载至少两张表 测试为了方便写在一个表里
 *
 * 点赞
 * author:lwj
 * date: 2022/9/5 20:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
//todo 注意这里需要统计 好评 中评 差评 数 在后台做判断，逻辑为想
public class Article {
    private Integer articleId;
    private String content; //数据库最好是text类型
    private JdUser formUser;
    private Integer formUserId; //评论人id
    private String createDatetime; //评论创建时间 注意数据库create_Datetime
    private Integer likeNum;//评论点赞数
    private Integer state;  //评论是否可见 0 不可见 1 可见
    private Integer parentId;  //评论的父评论  0是默认所有评论的超集 最好给非空键
    private ArrayList<Article> child; //这里嵌套评论
    private Integer star; // 用户给的星星  好评【5】中评【2,4】差评【0,1】
    private int type;
    private Integer toUserId; //被评论人的id
    private JdUser toUser;

//    private List<String> imgList; //todo 用户上传的图片 ，功能先关闭

    public Article(Integer articleId){
        setArticleId(articleId);
    }

    public Article(Integer articleId, String content, JdUser formUser, Integer formUserId, String createDatetime, Integer likeNum, Integer state, Integer parentId, ArrayList<Article> child, Integer star) {
        this.articleId = articleId;
        this.content = content;
        this.formUser = formUser;
        this.formUserId = formUserId;
        this.createDatetime = createDatetime;
        this.likeNum = likeNum;
        this.state = state;
        this.parentId = parentId;
        this.child = child;
        this.star = star;
    }
}
